package edu.sctu.zhuyingzhi.month201505.day20150517.homeworkV1;


import java.util.ArrayList;
import java.util.List;

/**
 * Created by user13 on 2015/5/17.
 */
public class TextOne extends TextMore {

    public void getTercherInfo(){

//        TexMain numberRank= new TexMain();

        Teacher[] teacherArray = sotrNumber();


        for (int i = 0; i < teacherArray.length; i++) {
            System.out.println(teacherArray[i].getNumber()+teacherArray[i].getName()+teacherArray[i].getSex()+teacherArray[i].getLesson());

            for (int j = 0; j < teacherArray[i].getStudent().length; j++)
            {
                System.out.println("学生是（"+teacherArray[i].getStudent()[j].getName()+")");
            }
        }


    }


    public void getStudent(int code){
        List<Student> list = sortStudent();
        List<Student> list1 = new ArrayList<>();
        System.out.println(list.size());

        for (int i = 0; i < list.size(); i++) {
            if(list.get(i).getGradle()>code){
                System.out.println(list.get(i).getName());
            }

        }



    }

    public void getCode(){

        Teacher[] teacherArray1 = teacher.TeacherMessage();
        List<Student> list = new ArrayList<>();

        for (int i = 0; i < (teacherArray1.length); i++) {

            for (int j = 0; j < (teacherArray1[i].getStudent().length); j++) {

                if (teacherArray1[i].getTitle().equals("教授")){
                    list.add(teacherArray1[i].getStudent()[j]);}
            }
        }

        InterMethod inter = new InterMethod() {
            @Override
            public void method(List<Student> list) {
                for (int i = 0; i < list.size(); i++) {

                    if (list.get(i).getGradle()>70){
                    System.out.println(list.get(i).getName());
                }}
            }
        };

        inter.method(list);

}

}
